<?php
namespace app\common\model;

use think\Model;

class Admin extends Model
{
    protected $pk = 'adm_id';
//    echo $insert;
    public function role(){
        return $this->belongsTo('Roles','adm_role','role_id')->field('role_id,role_name,role_auth_id');
    }

    public function getAdmStatusAttr($value)
    {
        $status = [0=>'禁用',1=>'启用'];
        return $status[$value];
    }

    protected $type = [
        'adm_status'    =>  'integer',
        'adm_create_time'  =>  'timestamp',
        'adm_last_login'  =>  'timestamp',
    ];

}